<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <title>Formulaire</title>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
</head>

<body>
  <h1>Mon premier formulaire !</h1>

<?
if (isset($_GET["nom"]) && $_GET["nom"]!="" && isset($_GET["prenom"])
        && $_GET["prenom"]!="" && isset($_GET["genre"])) {
    echo "Bonjour, " . ($_GET["genre"] == "f" ? "Mlle " : "M. ")
    . $_GET["nom"] ." ". $_GET["prenom"] . " !";
} else {
    $nom = (isset($_GET["nom"])) ? $_GET["nom"] : "";
    $prenom = (isset($_GET["prenom"])) ? $_GET["prenom"] : "";
    echo <<<END
  <form action="fornulaire1.php" method="get">
      <p>Nom :  <input name="nom" value="$nom"/></p>
    <p>Prénom : <input name="prenom" value="$prenom" /></p>
    <p>Genre :
      <input name="genre" value="f" type="radio" />F
      <input name="genre" value="m" type="radio" />M
    </p>
    <p><input type="submit" value="Valider" /></p>
  </form>
END;
}
?>
</body>
</html>